#pragma once

#include <QDialog>
#include <QPushButton>
#include <QLabel>
#include <osg\Vec3>
#include <osg\Vec2>
#include "layersmanager.h"
#include "environmentlayeractor.h"

class QTabWidget;
class QCheckBox;
class QComboBox;
class QLineEdit;
class QSpinBox;
class QSlider;

class SkyDomeSettingWidget:public QWidget
{
	Q_OBJECT
public:
	SkyDomeSettingWidget(QWidget* parent=0,Qt::WindowFlags f=0);
	~SkyDomeSettingWidget();

	struct SkyParameter
	{
		bool		_enable;
		//bool		_show;
		QString		_type;
		float		_radius;
	};
	void setSkyParameter(SkyParameter data);
	void getSkyParameter(SkyParameter& data);
private:
	QCheckBox*			_enableSky;
	//QCheckBox*			_showSky;
	QComboBox*			_skyType;
	QLineEdit*			_skyRadius;
	QString				_skyTypeString;
	float				_radius;
private slots:
	void slotValueChanged(int);
};

class OceanSettingWidget:public QWidget
{
	Q_OBJECT
public:
	OceanSettingWidget(QWidget* parent=0,Qt::WindowFlags f=0);
	~OceanSettingWidget();
	void setOceanParameter(VrDataCore::EnvironmentLayerActor::OceanSetting data);
	void getOceanParameter(VrDataCore::EnvironmentLayerActor::OceanSetting& data);
private:
	QCheckBox*			_enableOcean;
	QSpinBox*			_oceanWaveScale;
	QSpinBox*			_oceanFoamSpin;
	QComboBox*			_sizeX;
	QComboBox*			_sizeY;
	QLineEdit*			_transformZ;
	QStringList			_sizeList;
	VrDataCore::EnvironmentLayerActor::OceanSetting			_oceanSetting;
private slots:
	void slotValueChanged(int);
};

class DayAndNightSettingWidget:public QWidget
{
	Q_OBJECT
public:
	DayAndNightSettingWidget(QWidget* parent=0,Qt::WindowFlags f=0);
	~DayAndNightSettingWidget(){}
	void setOpenNightEffect(bool n);
private:
	QCheckBox*			_isNightCheckBox;
private slots:
	void slotValueChanged(int);
};

class OverallSoundSetting:public QWidget
{
	Q_OBJECT
public:
	OverallSoundSetting(QWidget* parent=0,Qt::WindowFlags f=0);
	~OverallSoundSetting(){}
	void setSoundActor(CoreBase::ActorBase* actor);
private:
	QCheckBox*								_enableSoundCheckBox;
	QSlider*								_gainSlider;
	QPushButton*							_soundFileBtn;
	QLabel*									_pathLabel;
	CoreBase::ActorBase*					_soundActor;
private slots:
	void slotValueChanged(int);
	void slotPushButtonClick();
	void slotStartSliderEditingFinished(int);
};

class EnvironmentSettingDialog : public QDialog
{
	Q_OBJECT
public:
	EnvironmentSettingDialog(QWidget* parent=0,Qt::WindowFlags f=0);
	~EnvironmentSettingDialog();

	void addAsOceanBorder(const osg::Vec3& pos);
private:
	QPushButton*							_okButton;
	QPushButton*							_cancelButton;
	QPushButton*							_useButton;
	QTabWidget*								_tabWidget;
	SkyDomeSettingWidget*					_skyDomeSetting;
	OceanSettingWidget*						_oceanSetting;
	DayAndNightSettingWidget*				_dayOrNightSettingWidget;
	SkyDomeSettingWidget::SkyParameter		_skyParameter;
	OverallSoundSetting*					_overallSoundSetting;
private slots:
	void slotEnter();
	void slotsCurrentMapChanged();
	void slotUse();
};